//
//  OrderdescTVC.m
//  LoveFreshBeen
//
//  Created by vinsent on 16/10/20.
//  Copyright © 2016年 魏根. All rights reserved.
//

#import "OrderdescTVC.h"
#import "OrderDescTableCell.h"
#import "AcceptManDescTableCell.h"
#import "OrderRealDescTableCell.h"
#import "CommontTableCell.h"

@interface OrderdescTVC ()

@end

@implementation OrderdescTVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
  
    
}

#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 4;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 1;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    switch (indexPath.section) {
        case 0:
        {
            OrderDescTableCell *cell = [[NSBundle mainBundle] loadNibNamed:@"OrderDescTableCell" owner:nil options:nil].lastObject;
            
            cell.order = self.orderVModel;
            
            return cell;
        }
            break;
        case 1:
        {
            AcceptManDescTableCell *cell = [[NSBundle mainBundle] loadNibNamed:@"AcceptManDescTableCell" owner:nil options:nil].lastObject;
            
            cell.order = self.orderVModel;
            
            return cell;
        }
            break;
        case 2:
        {
            OrderRealDescTableCell *cell = [[OrderRealDescTableCell alloc] init];
            cell.index = self.index;
            return cell;
        }
    }
    
    CommontTableCell *cell = [[NSBundle mainBundle] loadNibNamed:@"CommontTableCell" owner:nil options:nil].lastObject;
    
    cell.order = self.orderVModel;
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    switch (indexPath.section) {
        case 0:
            return 180;
            break;
        case 1:
            return 100;
            break;
        case 2:
            return 350;
        default:
            break;
    }
    return 180;
}
@end
